package com.dong.component;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;

/**
 * description
 *
 * @author Administrator 2021/09/02 18:45
 */
@Component
public class FactoryMethodComponent {

    @Bean
    public MyBean myBean(){
        return new MyBean();
    }

    @Bean
    public MyTestBean doSomething(@Qualifier("myBean") MyBean myBean){
        MyTestBean myTestBean = new MyTestBean();
        myTestBean.setMyBean(myBean);
        return myTestBean;
    }

}
